package com.hospital.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @description：
 * @author：zou
 * @date：2021/10/7 20:41
 * @versions：v1.0
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Autowired
    private LoginInterceptor loginInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //addInterceptor方法是注册一个生命周期拦截器，addPathPatterns方法是拦截的url地址，excludePathPatterns是排除哪些地址不拦截
//        registry.addInterceptor(loginInterceptor).addPathPatterns("/**").excludePathPatterns("/doctorLogin/toLogin", "/doctorLogin/login", "/static/**");
    }

}
